package servlet;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ServletForward extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("servletRedirect");
        req.getSession().setAttribute("name","过去");
        req.setAttribute("info","你好");
        RequestDispatcher dispatcher=req.getRequestDispatcher("../ff");
        dispatcher.forward(req,resp);

    }
}
